<template>
  <div>
    <van-cell-group>
      <van-cell label="描述信息" @click="godetail">
        <template #title>
          <div class="title">
            <img :src="msg.avatar" alt class="img" />
            <div class="content">
              <p class="title_title">{{msg.stem}}</p>
              <span>{{msg.creator}} | {{msg.createdAt}}</span>
            </div>
          </div>
        </template>
        <template #label>
          <div class="title_title article_content" v-html="msg.content"></div>
          <span>点赞 {{msg.likeCount}}</span>
          <span>|浏览 {{msg.views}}</span>
        </template>
      </van-cell>
    </van-cell-group>
  </div>
</template>

<script>
export default {
  name: 'CellView',
  props: {
    msg: {
      type: Object,
      require: true
    }
  },
  components: {},
  data () {
    return {

    }
  },
  computed: {},
  watch: {},
  created () {},
  mounted () {},
  methods: {
    godetail () {
      this.$router.push('/detail/' + this.msg.id)
    }
  }
}
</script>

<style lang="less" scoped>
.img {
  width: 80px;
  height: 80px;
}
.title {
  display: flex;
  .content {
    flex: 1;
  }
}
.title_title {
  font-size: 28px;
}
span {
  font-size: 24px;
}
.article_content {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
</style>
